export function isExternal(path: string) {
  return /^(http:|https:|tel:|mailto:)/.test(path)
}

export function getId(len = 32): string {
  const ids: Array<string> = []
  const str = "123456789wertyuiopasdfghjklmnbvczQWERTYUIOPLKJHGFDSAZXCVBNM"

  for (let i = 0; i < len; i++) {
    const index = Math.floor(Math.random() * str.length + 1)
    ids[i] = str[index]
  }
  const id: string = ids.join("")
  return id
}
